﻿var currentRowBgColor = "";

//Get the current background color of a hover row
function GetBgColor(element) {
    currentRowBgColor = element.style.backgroundColor;
}

function SetDropZone() {
    $(".productItemStyle").draggable({ helper: "clone", opacity: "0.5" });
    $(".dropZone").droppable({
        accept: ".productItemStyle",
        hoverClass: "dropHover",
        drop: function(ev, ui) {
            var droppedItem = ui.draggable.clone().addClass("productItemStyle");
            var productCodeAndPrice = droppedItem[0].attributes["code"].nodeValue + "|" + droppedItem[0].attributes["price"].nodeValue + "|" + droppedItem[0].attributes["matchedPrice"].nodeValue;
            //Call Update Shopping Cart Method                
            PageMethods.SetShoppingCartSesstion(productCodeAndPrice, SetShoppingCart);
            //PageMethods.SetShoppingCartSesstion(productCodeAndPrice, SetShoppingCart, OnSucceeded, OnFailed);
            //alert("thanh cong");
        }
    });
}
